<% content_tag :div, :class => 'bigwrapper' do%>
<%= flash[:error] %>
	<% content_tag :div, :class => 'editheader' do -%>
		<%= content_tag :img, nil, :src => '/images/icons/icons_49.png', :class => 'hleft' %>
		<%= content_tag :span, "<span class='smallgray'>edit fund </span>" + @fund.first_entry.name, :class => 'hleft' %>
		<% content_tag :span, :class => 'editheadertext' do -%>
			<%= content_tag :strong, "Fund's current information:" -%>
			<%= content_tag :div, "<span class='smallgray'>Note </span>" + @fund.first_entry.note -%>
			<%= content_tag :div, "<span class='smallgray'>Status </span>" + @fund.first_entry.status -%>
			<%= content_tag :div, "<span class='smallgray'>Last modified by </span>" + @fund.first_entry.created_by.fname -%>
			<% content_tag :p, :class => 'smallgray' do -%>
				<%= content_tag :span, 'New line item:<br/>' -%>
				<%= render :partial => 'partials/newline', :locals => {:@fund_id => @fund.id } -%>
			<% end -%>
		<% end -%>
		<% content_tag :div, :class => 'editcolumn1' do -%>
			<%= content_tag :span, "<strong>All notes added to this fund: </strong>" -%>
		    <% for entry in @fund_entries %>
				<% content_tag :div, :class => 'headertext' do -%>
		            <%= content_tag(:span, entry.created_at.strftime("%Y.%m.%d"), :class=>"smallgray") %>
					<%= content_tag(:strong, entry.name) %>
					<%= content_tag(:span, entry.note) %>
		            <%= content_tag :span, entry.status %>
				<% end -%>
		    <% end %>
			<% content_tag :div, :id => 'showoptions' do %>
		    	<% form_tag :action => 'edit_fund' do -%>
					<% content_tag :div, :class => 'header' do %>
						<%= content_tag :label, "Add a note (<span class='red'>*</span>)<br/>"%>
						<%= text_area(:fund_entry, :note, :size=>"46x5")%>
					<% end -%>
					<% content_tag :div, :class => 'header' do %>
						<%= content_tag :label, "Change fund's status (<span class='red'>*</span>)"%>
			            <%= select(:fund_entry, :status, ["Opened", "Hold", "Active", "Closed"],:selected=>@fund.first_entry.status) %>
					<% end -%>
					<% content_tag :div, :class => 'header' do %>
						<%= content_tag :label, "Change fund's title (<span class='red'>*</span>)"%>
			            <%= text_field(:fund_entry, :name,:value=>@fund.first_entry.name)%>
					<% end -%>
					<% content_tag :div, :class => 'header' do %>
			            <%= submit_tag 'Update Fund' -%>
					<% end -%>
			    <% end %>
			<% end %>
			<% content_tag :div, :class => 'lnk' do -%>
				<%= content_tag :img, nil, :src => '/images/icons/icons_54.png', :class => 'icon' -%>
		    	<%= link_to_function "<strong>Add a note to this fund</strong>", "$('showoptions').toggle()" -%>
			<% end -%>
			<%=  javascript_tag("$('showoptions').hide()") %>
		<% end -%>
		<% content_tag :div, :class => 'editcolumn2' do -%>
	    	<%= content_tag(:strong, "Line items in this fund:", :class => 'lnk' ) %>
		    <% for item in @line_items %>
				<% content_tag :div, :class=>"lnk" do -%>
					<%= content_tag :img, nil, :src => '/images/icons/icons_54.png', :class => 'icon' -%>
					<%= content_tag :a, item.first_entry.name, :href => '/finances/edit/' + item.id.to_s -%>
					<% if item.first_entry.amount < 0 -%>
						<%= content_tag :span, " $" + item.first_entry.amount.to_s, :class => 'red' -%>
					<% else -%>
						<%= content_tag :span, " $" + item.first_entry.amount.to_s -%> 
					<% end %>
				<% end -%>
		    <% end %>
		<% end -%>
	<% end -%>
<% end -%>